***Study 1 Analysis dofile****


*****************************************************EXPERIMENT************************************
****************************MODELS ********************************

pwcorr pid7n rresentment
mean rresentment if pid7n<.5
mean rresentment if pid7n==.5
mean rresentment if pid7n>.5



**Histograpm DV*****


**Appendix Figure A1a
histogram residents,  frequency  color(eltblue) lcolor(none) title("Figure A1. Distribution of Support for Resident Oversight of Policy") xtitle("Residents") ytitle("Frequency") graphregion(color(white)) scheme(s1color)

**Appendix Figure A1b
histogram cat_dv,  frequency  color(eltblue) lcolor(none) title("Figure A1b. Distribution of Support for Oversight") xtitle("Oversight") ytitle("Frequency") graphregion(color(white)) scheme(s1color)
	
*Appendix Figure A2
histogram rresentment,  frequency  color(eltblue) lcolor(none) title("Figure A2. Distribution of Racial Resentment (Proxy)") xtitle("Racial Resentment") ytitle("Frequency") graphregion(color(white)) scheme(s1color)	

*Appendix Figure A3
histogram pid7n,  frequency  color(eltblue) lcolor(none) title("Figure A3. Distribution of Partisanship") xtitle("Partisanship") ytitle("Frequency") graphregion(color(white)) scheme(s1color)	

*Figure 2
reg residents i.treatment, r
margins treatment
marginsplot, recast(scatter) recastci(rcap) plotopts(msymbol(O) msize(medium) color(navy)) ciopts(lcolor(navy)) name(pred_plot, replace)ytitle("Support for Residents Being Responsible")  xtitle("Treatment Group") title("Predicted Margins and Group Means") legend(order(1 "Predicted Margin" 2 "95% CI"))

*FIGURE 3: Combined Interaction Effects 

reg residents i.treatment##c.rresentment i.treatment##c.pid7n ideol1 female parent age3044 age4564 age65p college income2 bornagain [pw=weight]

* First interaction plot: Treatment × Racial Resentment
margins treatment, at(rresentment =(0(.5)1))
marginsplot, xdimension(rresentment ) recast(line) recastci(rarea) ciopts(color(%20)) ytitle("Predicted Support for Residents' Control") xtitle("Racial Resentment") title("Interaction: Treatment × Racial Resentment") legend(pos(6)) name(gr1, replace)

* Second interaction plot: Treatment × Partisanship
margins treatment, at(pid7n=(0(.5)1))
marginsplot, xdimension(pid7n) recast(line) recastci(rarea) ciopts(color(%20)) ytitle("Predicted Support for Residents' Control")xtitle("Partisanship") title("Interaction: Treatment × Partisanship") legend(pos(6)) name(gr2, replace)

* Combine the two graphs side by side
graph combine gr1 gr2, col(2)


******

*Figure 4: THree-way Interaction & Interaction Plot

reg residents i.treatment##c.pid7n##c.rresentment ideol1 female parent age3044 age4564 age65p college income2 bornagain [pw=weight]
margins treatment, at(pid7n=(0 .5 1) rresentment=(0 .5 1))
marginsplot, xdimension(rresentment) by(pid7n)  recast(line) recastci(rarea) ciopts(color(%20))  ytitle("Figure 4. Predicted Support for Resident Control of Policy") xtitle("Racial Resentment") title("3-Way Interaction: Treatment × Partisanship × Racial Resentment")  legend(off)

***Table 1

eststo: reg residents i.treatment if white==1 [pw=weight]
eststo: reg residents i.treatment c.rresentment pid7n ideol1 female parent age3044 age4564 age65p college income2  bornagain if white==1 [pw=weight]
eststo: reg residents i.treatment##c.rresentment pid7n ideol1 female parent age3044 age4564 age65p college income2  bornagain if white==1 [pw=weight]
eststo: reg residents c.rresentment i.treatment##c.pid7n ideol1 female parent age3044 age4564 age65p college income2  bornagain if white==1 [pw=weight]
eststo: reg residents i.treatment##c.rresentment i.treatment##c.pid7n ideol1 female parent age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]

estout using "C:\Users\Alexandra Filindra\Dropbox\My Research Projects\Currently active\3. Education-control of decisions\education-curriculum\stata_results.txt", style(fixed) stats(N r2_a F p, fmt(4 3)) cells("b(star fmt(3))" se(par(`"="("'`")""')fmt(2))) starlevels(* 0.10 ** 0.05 *** 0.01) replace

eststo clear


****LPM Models*********************************

eststo: reg residents i.treatment if white==1 [pw=weight]

eststo: reg residents i.treatment##c.rresentment pid7n ideol1 female parent age3044 age4564 age65p college income2  bornagain if white==1 [pw=weight]
eststo: reg residents i.treatment##c.rresentment i.treatment##c.pid7n ideol1 female parent age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]

eststo: reg residents i.treatment##c.rresentment##c.pid7n ideol1 female parent age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]
eststo: reg residents i.treatment##i.female c.rresentment pid7n ideol1 parent age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]
eststo: reg residents i.treatment##i.parent c.rresentment pid7n ideol1 female age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]
eststo: reg residents i.treatment##i.bornagain c.rresentment pid7n ideol1 female parent age3044 age4564 age65p college income2 i.religpew if white==1 [pw=weight]
estout using "C:\Users\Alexandra Filindra\Dropbox\My Research Projects\Currently active\3. Education-control of decisions\education v police experiment\results\yougovresults.txt", style(fixed) stats(N r2_a F p, fmt(4 3)) cells("b(star fmt(3))" se(par(`"="("'`")""')fmt(2))) starlevels(* 0.10 ** 0.05 *** 0.01) replace

eststo clear

reg residents i.treatment##c.rresentment i.treatment##c.pid7n ideol1 female age3044 age4564 age65p college income2 i.religpew bornagain  if white==1 [pw=weight]
margins treatment, at (pid7n=(0 .2  .4 .6  .8  1))
marginsplot

***Logistic Models*************************************
eststo: logit residents i.treatment if white==1 [pw=weight]
eststo: logit residents i.treatment rresentment  if white==1 [pw=weight]
eststo: logit residents i.treatment##c.rresentment  if white==1 [pw=weight]
margins treatment, at (rresentment=(0 .2  .4 .6  .8  1))
marginsplot

eststo: logit residents i.treatment##c.rresentment pid7n ideol1 female parent age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]
eststo: logit residents i.treatment##c.rresentment i.treatment##c.pid7n ideol1 female parent age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]
eststo: logit residents i.treatment##c.rresentment##c.pid7n ideol1 female parent age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]
eststo: logit residents i.treatment##i.female c.rresentment pid7n ideol1 parent age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]
eststo: logit residents i.treatment##i.parent c.rresentment pid7n ideol1 female age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]
eststo: logit residents i.treatment##i.bornagain c.rresentment pid7n ideol1 female parent age3044 age4564 age65p college income2 i.religpew if white==1 [pw=weight]
estout using "C:\Users\aleka\Dropbox\My Research Projects\Currently active\3. Education-control of decisions\education v police experiment\results\yougovresults.txt", style(fixed) stats(N r2_a F p, fmt(4 3)) cells("b(star fmt(3))" se(par(`"="("'`")""')fmt(2))) starlevels(* 0.10 ** 0.05 *** 0.01) replace

eststo clear

***Multinomial Models****

eststo: mlogit cat_dv i.treatment if white==1 [pw=weight]
eststo: mlogit cat_dv i.treatment rresentment  if white==1 [pw=weight]
eststo: mlogit cat_dv i.treatment##c.rresentment  if white==1 [pw=weight]
eststo: mlogit cat_dv i.treatment##c.pid7n  if white==1 [pw=weight]
estout using "C:\Users\aleka\Dropbox\My Research Projects\Currently active\3. Education-control of decisions\education v police experiment\results\yougovresults.txt", style(fixed) stats(N r2_a F p, fmt(4 3)) cells("b(star fmt(3))" se(par(`"="("'`")""')fmt(2))) starlevels(* 0.10 ** 0.05 *** 0.01) replace

eststo clear

sum residents i.treatment c.rresentment pid7n ideol1 female age3044 age4564 age65p college income2 if white==1 [iw=weight]

***Additional models per preregistration***
**ECONOMIC SITUATION**
eststo: reg residents i.treatment c.personalfin rresentment pid7 ideol1 female age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]
eststo: reg residents i.treatment##c.personalfin rresentment pid7 ideol1 female age3044 age4564 age65p college income2 bornagain if white==1 [pw=weight]
test c.personalfin 1.treatment#c.personalfin
test c.personalfin 1.treatment#c.personalfin
* ( 1)  personalfin = 0
 *( 2)  1.treatment#c.personalfin = 0

 *      F(  2,  1233) =    3.51
 *           Prob > F =    0.0303


eststo: reg residents i.treatment##c.rresentment i.treatment##c.personalfin pid7 ideol1 female age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]
test c.personalfin 1.treatment#c.personalfin
. test c.personalfin 1.treatment#c.personalfin

 *( 1)  personalfin = 0
 *(2)  1.treatment#c.personalfin = 0

  *     F(  2,  1232) =    2.55
  *          Prob > F =    0.0784


eststo: reg residents i.treatment##c.rresentment##c.personalfin pid7 ideol1 female age3044 age4564 age65p college income2 i.religpew bornagain if white==1 [pw=weight]
test c.personalfin 1.treatment#c.personalfin 1.treatment#c.personalfin#c.rresentment c.personalfin#c.rresentment

 *( 1)  personalfin = 0
 *( 2)  1.treatment#c.personalfin = 0
 *( 3)  1.treatment#c.rresentment#c.personalfin = 0
 *( 4)  c.rresentment#c.personalfin = 0

  *     F(  4,  1230) =    1.71
  *          Prob > F =    0.1453


estout using "C:\Users\aleka\Dropbox\My Research Projects\Currently active\3. Education-control of decisions\education v police experiment\results\yougovresults.txt", style(fixed) stats(N r2_a F p, fmt(4 3)) cells("b(star fmt(3))" se(par(`"="("'`")""')fmt(2))) starlevels(* 0.10 ** 0.05 *** 0.01) replace

eststo clear



*******BALANCE TESTS**********

drop if white==0

reg treatment female
reg treatment income2
reg treatment pid7
reg treatment ideol1
reg treatment age1829
reg treatment age3044
reg treatment age4564
reg treatment age 65p
reg treatment college

*Cells are balance across all variables.



